package com.huawei.classroom.student.h06;

public class WarFactory extends Building{
	public WarFactory(int xx,int yy) {
		x=xx;
		y=yy;
		health=100;
		force=0;
		range=0;
	}
	public Role building(EnumObjectType type) {
		if(type==EnumObjectType.mediumTank)
			return new MediumTank(x,y);
		if(type==EnumObjectType.heavyTank)
			return new HeavyTank(x,y);
		else {
			System.out.println("Error, only mediumTank or heavyTank");
			return null;
		}
	}
}
